<?php
$params = array_merge(
    require __DIR__ . '/../../common/config/params.php',
    require __DIR__ . '/../../common/config/params-local.php',
    require __DIR__ . '/params.php',
    require __DIR__ . '/params-local.php'
);

return [
    'id' => 'app-backend',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'modules' => [],
    'homeUrl' => '/admin',
    'components' => [
        'request' => [
            'baseUrl' => '/admin',
            'csrfParam' => '_csrf-backend',
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
        ],
        'session' => [
            // this is the name of the session cookie used for login on the backend
            'name' => 'advanced-backend',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                'login/check'=>'login/checklogin',
                /**
                 * 申报项目
                 */
                'principal/add'=>'principal/adddoproject',//添加
                'principal/save'=>'principal/saveproject',//保存
                'principal/submit'=>'principal/submitproject',//提交
                'principal/sGrank'=>'principal/selectgrank',//查询发放方式
                'principal/sPatent'=>'principal/selectpatent',//查询论文类型
                'principal/sThesis'=>'principal/selectthesis',//查询专利类型
                'principal/detail'=>'principal/detailproject',//详情

                /**
                 * 申报项目
                 */

                /**
                 * 在研项目
                 */
                'research/lpThesis'=>'research/thesislistport',//论文列表
                'research/apThesis'=>'research/addportthesis',//论文添加
                'research/spThesis'=>'research/saveportthesis',//论文保存
                'research/bpThesis'=>'research/submitportthesis',//论文提交
                'research/dpThesis'=>'research/detailportthesis',//论文详情
                'research/conditionThesis'=>'research/selectconditionthesis',//论文条件搜索

                'research/lpPatent'=>'research/patentlistport',//专利列表
                'research/apPatent'=>'research/addportpatent',//专利添加
                'research/spPatent'=>'research/saveportpatent',//专利保存
                'research/bpPatent'=>'research/submitportpatent',//专利提交
                'research/dpPatent'=>'research/detailportpatent',//专利详情
                'research/searchPatent'=>'research/selectconditionpatent',//专利条件搜索

                'research/apPilot'=>'research/addportpilot',//示范应用添加
                'research/spPilot'=>'research/saveportpilot',//示范应用保存
                'research/bpPilot'=>'research/submitportpilot',//示范应用提交
                'research/dpPilot'=>'research/detailportpilot',//示范应用详情
                'research/searchPilot'=>'research/selectsearchpilot',//示范应用条件搜索

                'research/pName'=>'research/projectname',//查询项目名称


                'research/apSpecial'=>'research/add-port-special',//添加专家管理
                'research/spSpecial'=>'research/save-port-special',//保存专家管理
                'research/bpSpecial'=>'research/submit-port-special',//提交专家管理
                'research/lpSpecial'=>'research/special-port-list',//专家管理列表
                'research/dpSpecial'=>'research/detail-port-special',//专家管理详情
                'research/delSpecial'=>'research/del-special',//删除专家管理


                //其他
                'researchOther/spPlan'=>'research-other/select-port-plan',//查询进度列表

                /**
                 * 在研项目
                 */


                /**
                 * start
                 * 专家验收
                 */
                'special/check'=>'special/project-port-check',//验收
                'special/ppList'=>'special/project-port-list',//待验收列表
                'special/ppCheck'=>'special/project-port-check',//验收  编辑
                'special/cpSave'=>'special/check-port-save',//验收  编辑

                /**
                 * end
                 * 专家验收
                 */

            ],
        ],
        
    ],
    'params' => $params,
];
